package com.yehebl.handler.manager;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

/**
 * 参数map
 * 
 * @author tzd
 *
 */
public class MethodManager {
	private Map<String, Method> map = new HashMap<String, Method>();

	/**
	 * 添加参数map
	 * 
	 * @param key
	 * @param clazzs
	 */
	public  void add(String key, Method method) {
		if (map.containsKey(key)) {
			throw new RuntimeException("处理器[" + key + "]重复");
		}
		map.put(key, method);
	}

	public  Method get(String key) {
		if (!map.containsKey(key)) {
			throw new RuntimeException("找不到处理器[" + key + "]");
		}
		return map.get(key);
	}
}
